<?php
namespace App\Http\Service\Admin;


use App\Http\Service\Basic\BasicService;
use Config;

class AdminService extends BasicService
{

    //构造函数
    function __construct()
    {
        parent::__construct();
    }

    //登录
    public function login($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.login'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }







    //退出登录
    public function logout($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.logout'),$where, 'get');
    }
    //管理员列表
    public function getAdminList($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_admin_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get_admin_list'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    // 管理员修改
    public function doAdminUpdate($where)
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.adminupdate'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    /**
     * 管理员信息删除
     */
    public function doAdminDelete($where)
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.admin_delete'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    //管理员添加
    public function doAdminAdd($where)
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.admin_add'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }


}